using UnityEngine;

public class SPR_FaceTarget : MonoBehaviour
{
	public bool Active;

	public bool TargetPlayer;

	[SerializeField]
	private Transform Target;

	[SerializeField]
	private Animator TargetAnimator;

	[SerializeField]
	private string DirectionParameter_X;

	[SerializeField]
	private string DirectionParameter_Y;

	private void Update()
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		if (Active)
		{
			Vector2 val = Vector2.op_Implicit(Vector3.zero);
			val = (TargetPlayer ? Vector2.op_Implicit(((Component)PlayerManager.Instance).transform.position - ((Component)this).transform.position) : Vector2.op_Implicit(Target.position - ((Component)this).transform.position));
			TargetAnimator.SetFloat(DirectionParameter_X, val.x);
			TargetAnimator.SetFloat(DirectionParameter_Y, val.y);
		}
	}
}
